package com.shangjinrong.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.math.BigDecimal;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
    * 还款记录表
    */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "lend_return")
public class LendReturn {
    /**
     * 编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 标的id
     */
    @TableField(value = "lend_id")
    private Long lendId;

    /**
     * 借款信息id
     */
    @TableField(value = "borrow_info_id")
    private Long borrowInfoId;

    /**
     * 还款批次号
     */
    @TableField(value = "return_no")
    private String returnNo;

    /**
     * 借款人用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 借款金额
     */
    @TableField(value = "amount")
    private BigDecimal amount;

    /**
     * 计息本金额
     */
    @TableField(value = "base_amount")
    private BigDecimal baseAmount;

    /**
     * 当前的期数
     */
    @TableField(value = "current_period")
    private Integer currentPeriod;

    /**
     * 年化利率
     */
    @TableField(value = "lend_year_rate")
    private BigDecimal lendYearRate;

    /**
     * 还款方式 1-等额本息 2-等额本金 3-每月还息一次还本 4-一次还本
     */
    @TableField(value = "return_method")
    private Byte returnMethod;

    /**
     * 本金
     */
    @TableField(value = "principal")
    private BigDecimal principal;

    /**
     * 利息
     */
    @TableField(value = "interest")
    private BigDecimal interest;

    /**
     * 本息
     */
    @TableField(value = "total")
    private BigDecimal total;

    /**
     * 手续费
     */
    @TableField(value = "fee")
    private BigDecimal fee;

    /**
     * 还款时指定的还款日期
     */
    @TableField(value = "return_date")
    private Date returnDate;

    /**
     * 实际发生的还款时间
     */
    @TableField(value = "real_return_time")
    private Date realReturnTime;

    /**
     * 是否逾期
     */
    @TableField(value = "is_overdue")
    private Boolean isOverdue;

    /**
     * 逾期金额
     */
    @TableField(value = "overdue_total")
    private BigDecimal overdueTotal;

    /**
     * 是否最后一次还款
     */
    @TableField(value = "is_last")
    private Boolean isLast;

    /**
     * 状态（0-未归还 1-已归还）
     */
    @TableField(value = "status")
    private Byte status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 逻辑删除(1:已删除，0:未删除)
     */
    @TableField(value = "is_deleted")
    @TableLogic
    private Boolean isDeleted;

    public static final String COL_ID = "id";

    public static final String COL_LEND_ID = "lend_id";

    public static final String COL_BORROW_INFO_ID = "borrow_info_id";

    public static final String COL_RETURN_NO = "return_no";

    public static final String COL_USER_ID = "user_id";

    public static final String COL_AMOUNT = "amount";

    public static final String COL_BASE_AMOUNT = "base_amount";

    public static final String COL_CURRENT_PERIOD = "current_period";

    public static final String COL_LEND_YEAR_RATE = "lend_year_rate";

    public static final String COL_RETURN_METHOD = "return_method";

    public static final String COL_PRINCIPAL = "principal";

    public static final String COL_INTEREST = "interest";

    public static final String COL_TOTAL = "total";

    public static final String COL_FEE = "fee";

    public static final String COL_RETURN_DATE = "return_date";

    public static final String COL_REAL_RETURN_TIME = "real_return_time";

    public static final String COL_IS_OVERDUE = "is_overdue";

    public static final String COL_OVERDUE_TOTAL = "overdue_total";

    public static final String COL_IS_LAST = "is_last";

    public static final String COL_STATUS = "status";

    public static final String COL_CREATE_TIME = "create_time";

    public static final String COL_UPDATE_TIME = "update_time";

    public static final String COL_IS_DELETED = "is_deleted";
}